home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Mania 4
/
MacMania 4.toast
/
/
Demo's
/
Igor Demo Pro
/
1 PutContentsIn Igor Pro Folder
/
WaveMetrics Procedures
/
Graphing
/
Axis Utilities
< prev
next >
Wrap
Text File
|
1994-02-18
|
1KB
|
65 lines
| Axis Utilities
#include <Strings as Lists>
Function/S HVAxisList(graphNameStr,wantHorizAxes)
String graphNameStr;Variable wantHorizAxes
String hvlist="",axlist,inf
String axis
Variable index=0
axlist=AxisList(graphNameStr)
do
axis= GetStrFromList(axlist, index, ";")
if (strlen(axis) == 0)
break | ran out of items
endif
inf=AxisInfo(graphNameStr,axis)
if( AxisOrientation(inf,wantHorizAxes) )
hvlist += axis + ";"
endif
index += 1
while (1) | loop until break above
return hvlist
End
| Returns 1 if axis has desired orientation, else returns 0
Function AxisOrientation(axisInfo,wantHorizAxes)
String axisInfo;Variable wantHorizAxes
if( wantHorizAxes )
if( strsearch(axisInfo,"AXTYPE:bottom;",0) < 0 )
if( strsearch(axisInfo,"AXTYPE:top;",0) < 0 )
return 0
endif
endif
else
if( strsearch(axisInfo,"AXTYPE:left;",0) < 0 )
if( strsearch(axisInfo,"AXTYPE:right;",0) < 0 )
return 0
endif
endif
endif
return 1
End
| returns axis units, which often are ""
Function/S AxisUnits(axis)
String axis
String inf,units=""
Variable st,en
inf=AxisInfo("",axis)
st= strsearch(inf,"UNITS:",0)
if( st >= 0 )
en= strsearch(inf,";",st)
if( en > st )
units=inf[st+6,en-1]
endif
endif
return units
End